package com.itheima.service.impl;

import com.itheima.dao.AccountDao;
import com.itheima.pojo.Account;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

//给IOC容器管理
@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    AccountDao dao;
    @Override
    public List<Account> findAll() {
        //TODO: 待会要去dao层获取数据
//        List<Account> list = new ArrayList();
//        list.add(new Account(1,"tom1",10001.0));
//        list.add(new Account(2,"tom2",10002.0));
//        list.add(new Account(3,"tom3",10003.0));
        List<Account> list = dao.findAll();
        return list;
    }
}
